package main

import (
	//"fmt"
	"os/exec"
	. "windownload/winFrom"
	//"io"
	//"net/http"
	//"os"
	//"strings"
	"strconv"
	//"time"
)

func runcmd() {

	exec.Command("download.bat").Run()

}
func main() {

	//图形化 编译时加上flag，让程序运行的时候隐藏cmd
	//go build -ldflags="-H windowsgui"
	//mw := new(MyMainWindow)
	//mw.Urlmodel = NewUrlModel()
	//mw.Urlmodel.Num1 = strconv.Itoa(mw.Urlmodel.RetUrlDownlodingCount())
	//mw.Urlmodel.Ini_Tb_url(`select top ` + mw.Urlmodel.Num1 + `  urlid,url,isDownload,startTime,endTime
	//	from Tb_url where isDownload='0' `)
	//StartDownChann(mw)

	mw := new(MyMainWindow)

	mw.Urlmodel = NewUrlModel()
	mw.Urlmodel.Num1 = strconv.Itoa(mw.Urlmodel.RetUrlDownlodingCount())
	mw.Urlmodel.Ini_Tb_url(`select top ` + mw.Urlmodel.Num1 + `  urlid,url,isDownload,startTime,endTime
		from Tb_url where isDownload='0' `)

	go runcmd()
	Formshow(mw)

}
